// reduce 迭代 
const flatter = (arr) => {
    return arr.reduce((pre,num) => 
        pre.concat(Array.isArray(num) ? flatter(num) : num)
    ,[])
}
console.log(flatter([1,2,3,[1,2,[3,4]]]))
